import React, {useEffect, useRef, useState} from 'react';
import './css/location.moudel.css'
import axios from "axios";


function Location() {
    let [location,setLocation]=useState('')
    const ref:any=useRef(window);
    let params:number=ref.current.location.href.split('detailid=')[1];
    useEffect(()=>{
        axios.get("/getLocation",{params:{"detailid":params}})
            .then((data)=>{
                let mytitle:any=data.data[0]
                setLocation(mytitle.title)
            })
    },[])
    return (
        <h1>{location}</h1>
    );
}

export default Location;